<script>
  var arr=["America","Greece","Britain","Canada","China","Egypt"];
  var count=0;
  for(var i=0;i<arr.length;i++){
    if(arr[i].indexOf("a")>=0||arr[i].indexOf("A")>=0){
	count++;
	}
  }
  document.write("a and A count:"+count);
</script>